#include "SeqList.h"

void TestSeqList1()
{
	SL sl;
	SeqListInit(&sl);
	SeqListPushBack(&sl, 1);
	SeqListPushBack(&sl, 2);
	SeqListPushBack(&sl, 3);
	SeqListPushBack(&sl, 4);
	SeqListPushBack(&sl, 5);
	SeqListPushBack(&sl, 6);
	SeqListPushFront(&sl, 10);
	SeqListPushFront(&sl, 100);
	SeqListPrint(&sl);
}

void TestSeqList2()
{

	SL sl;
	SeqListInit(&sl);
	SeqListPushBack(&sl, 1);
	SeqListPushBack(&sl, 2);
	SeqListPushBack(&sl, 3);
	SeqListPushBack(&sl, 4);
	SeqListPopBack(&sl);
	SeqListPopBack(&sl);
	SeqListPopBack(&sl);
	//SeqListPopBack(&sl);
	//SeqListPopFront(&sl);
	//SeqListPopFront(&sl);
	//SeqListPopFront(&sl);
	//SeqListPopFront(&sl);
	SeqListPrint(&sl);
}

void TestSeqList3()
{
	SL sl;
	SeqListInit(&sl);
	SeqListPushBack(&sl, 1);
	SeqListPushBack(&sl, 2);
	SeqListPushBack(&sl, 3);
	SeqListPushBack(&sl, 4);
	int pos = SeqListFind(&sl,2);
	if (pos != -1)
		SeqListModify(&sl, pos, 20);
	SeqListPrint(&sl);
}
void TestSeqList4()
{
	SL sl;
	SeqListInit(&sl);
	SeqListPushBack(&sl, 1);
	SeqListPushBack(&sl, 2);
	SeqListPushBack(&sl, 3);
	SeqListPushBack(&sl, 4);
	SeqListInsert(&sl, 1, 10);
	SeqListInsert(&sl, 1, 100);
	SeqListErase(&sl, 1);
	SeqListErase(&sl, 4);
	SeqListPrint(&sl);
	SeqListDestory(&sl);
}
int main()
{
	TestSeqList2();
	return 0;
}